<?php
defined('SYSPATH') OR die('No direct access allowed.');
/**
 * form.php
 * @author ranuandra
 *
 * 22 Agu 2011 08:18:02
 *
 * 
 */

$level = array('user', 'admin');
?>
	<div id="wrapper">
	<div class="form-container">
		<?php echo Form::open(URL::base().'user/save', array('class' => 'formdata', 'targetdata' => '.form', 'targeturl' => 'user')); ?>
		<div class="form_description">
			<h2>
			<?php 
			if(isset($title))
			{
				echo $title;
			}
			?>
			</h2>
			<p>
			<?php 
			if(isset($desc))
			{
				echo $desc;
			}
			?>
			</p>
		</div>	
		
		<fieldset>
			<legend>User</legend>	
			<div><label for="menu">Username </label> 						
			<?php 
				echo Form::input('username', $form['username'], array());
			?>
			</div>
			<div><label for="controller">Password </label> 						
			<?php 
				echo Form::password('password', $form['password'], array());
			?>
			</div>		
			<div><label for="controller">Confirm Password </label> 						
			<?php 
				echo Form::password('password_confirm', $form['password_confirm'], array());
			?>
			</div>			
			<div><label for="controller">E-Mail </label> 						
			<?php 
				echo Form::input('email', $form['email'], array());
			?>
			</div>
			<div><label for="controller">Level </label> 						
			<?php 
				echo Form::select('level', $level, '', array('class'=>'element select medium'));
			?>
			</div>
			<div>
				<div><label for="controller">Area </label> 
			    <?php echo Form::select('area_id[]', $arealist, $userarea, array('class'=>'element select medium','id' => 'selarea', 'multiple'=>'multiple')); ?>
			</div>
			
			
		</fieldset>				
	<div class="buttonrow">
		<input type="submit" value="Save" class="button" />
		<input type="button" value="Discard" class="button" />
	</div>
<?php 
	Form::close();
?>
	</div>
	</div>